﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;

namespace WaveMaster.Holidays.Club.Domain
{
    public class TravelAgent
    {
        long m_travelAgentId = 0;
        string m_code = string.Empty;

        string m_name = "";
        string m_regNo = "";
        string m_address = "";
        string m_zipcode = "";
        string m_contactPerson = "";
        string m_phone = "";
        string m_fax = "";
        string m_email = "";
        string m_website = "";
        bool m_active = true;
        MemberTypeEnum m_memberTypeEnum = MemberTypeEnum.Silver;
        MemberType m_memberType = null;
        DateTime m_registrationDate;
        DateTime m_expiredDate;
        DateTime m_cretnDate;
        DateTime m_modfctnDate;
        long m_cretnBy;
        long m_modfctnBy;

        string m_firstName = "";
        string m_lastName = "";
        string m_gender = "";
        string m_mobilePhone = "";
        string m_memberEmail = "";

        public TravelAgent() { }
        public TravelAgent(long id) 
        {
            m_travelAgentId = id;
        }
        public TravelAgent(long id, string name)
        {
            m_travelAgentId = id;
            m_name = name;
        }
        public TravelAgent(MySqlDataReader rd)
        {
            m_travelAgentId = Convert.ToInt64(rd["m_travelAgentId"]);
            m_code = rd["m_code"].ToString();
            m_name = rd["m_name"].ToString();
            m_address = rd["m_address"].ToString();
            m_zipcode = rd["m_zipcode"].ToString();
            m_contactPerson = rd["m_contactPerson"].ToString();
            m_phone = rd["m_phone"].ToString();
            m_fax = rd["m_fax"].ToString();
            m_email = rd["m_email"].ToString();
            m_website = rd["m_website"].ToString();
            m_active = Convert.ToBoolean(rd["m_active"]);
            m_cretnDate = Convert.ToDateTime(rd["m_cretnDate"]);
            m_cretnBy = Convert.ToInt64(rd["m_cretnBy"]);
            m_modfctnDate = Convert.ToDateTime(rd["m_modfctnDate"]);
            m_modfctnBy = Convert.ToInt64(rd["m_modfctnBy"]);
            m_memberTypeEnum = (MemberTypeEnum)Enum.Parse(typeof(MemberTypeEnum), rd["m_memberType"].ToString());
            m_memberType = new MemberType(Convert.ToInt64(rd["m_member_type_id"]));
            m_registrationDate = Convert.ToDateTime(rd["m_registrationDate"]);
            m_expiredDate = Convert.ToDateTime(rd["m_expiredDate"]);

            m_regNo = rd["m_regNo"].ToString();
            m_firstName = rd["m_firstName"].ToString();
            m_lastName = rd["m_lastName"].ToString();
            m_gender = rd["m_gender"].ToString();
            m_mobilePhone = rd["m_mobilePhone"].ToString();
            m_memberEmail = rd["m_memberEmail"].ToString();
        }

       

        public long TravelAgentID
        {
            get { return m_travelAgentId; }
            set { m_travelAgentId = value; }
        }
        public string Code
        {
            get { return m_code; }
            set { m_code = value; }
        }
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }
        public string Address
        {
            get { return m_address; }
            set { m_address = value; }
        }
        public string ZipCode
        {
            get { return m_zipcode; }
            set { m_zipcode = value; }
        }
        public string ContactPerson
        {
            get { return m_contactPerson; }
            set { m_contactPerson = value; }
        }
        public string Phone
        {
            get { return m_phone; }
            set { m_phone = value; }
        }
        public string Fax
        {
            get { return m_fax; }
            set { m_fax = value; }
        }
        public string Email
        {
            get { return m_email; }
            set { m_email = value; }
        }
        public string WebSite
        {
            get { return m_website; }
            set { m_website = value; }
        }
        public bool Active
        {
            get { return m_active; }
            set { m_active = value; }
        }
        public DateTime CreatenDate
        {
            get { return m_cretnDate; }
            set { m_cretnDate = value; }
        }
        public long CreatenBy
        {
            get { return m_cretnBy; }
            set { m_cretnBy = value; }
        }
        public DateTime ModificationDate
        {
            get { return m_modfctnDate; }
            set { m_modfctnDate = value; }
        }
        public long ModificationBy
        {
            get { return m_modfctnBy; }
            set { m_modfctnBy = value; }
        }
        public MemberTypeEnum MemberTypeEnum
        {
            get { return m_memberTypeEnum; }
            set { m_memberTypeEnum = value; }
        }
        public MemberType MemberType
        {
            get { return m_memberType; }
            set { m_memberType = value; }
        }
        public DateTime RegisterDate
        {
            get { return m_registrationDate; }
            set { m_registrationDate = value; }
        }
        public DateTime ExpiredDate
        {
            get { return m_expiredDate; }
            set { m_expiredDate = value; }
        }
        public string RegNo
        {
            get { return m_regNo; }
            set { m_regNo = value; }
        }
        public string FirstName
        {
            get { return m_firstName; }
            set { m_firstName = value; }
        }
        public string LastName
        {
            get { return m_lastName; }
            set { m_lastName = value; }
        }
        public string Gender
        {
            get { return m_gender; }
            set { m_gender = value; }
        }
        public string MobilePhone
        {
            get { return m_mobilePhone; }
            set { m_mobilePhone = value; }
        }
        public string MemberEmail
        {
            get { return m_memberEmail; }
            set { m_memberEmail = value; }
        }
        public override string ToString()
        {
            return m_name;
        }
    }
}
